package com.heiye.relation.biz.domain.mapper;

import com.heiye.relation.biz.domain.dataobject.QuizFansDO;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface QuizFansDOMapper {
    int deleteByPrimaryKey(Long id);

    int insert(QuizFansDO record);

    int insertSelective(QuizFansDO record);

    QuizFansDO selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(QuizFansDO record);

    int updateByPrimaryKey(QuizFansDO record);

    /**
     * 根据问题 ID 和粉丝 ID 删除粉丝关系
     *
     * @param quizId
     * @param fansUserId
     * @return
     */
    int deleteByQuizIdAndFansUserId(@Param("quizId") Long quizId,
                                    @Param("fansUserId") Long fansUserId);

    /**
     * 根据问题 ID 批量查询粉丝关系
     *
     * @param quizIds
     * @return
     */
    List<QuizFansDO> selectTop10FansByQuizIds(@Param("quizIds") List<Long> quizIds);
}